/*
 * Copyright (C) 2011 Dirk Weißenborn, dirk.weissenborn@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.weissenborn.colabtex.client.places;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;

/**
 * The Class Workplace is the place which corresponds to the tex activity, where pads are written and compiled
 */
public class Workplace extends Place {
  
	/** The padname. */
	private String padname;
	
	/** The pad url. */
	private String padUrl;

	/**
	 * Instantiates a new workplace.
	 *
	 * @param padname the padname
	 * @param padUrl the pad url
	 */
	public Workplace(String padname, String padUrl) {
		this.padname = padname;
		this.padUrl = padUrl;
	}

	/**
	 * Gets the name.
	 *
	 * @return the name
	 */
	public String getName() {
		return padname;
	}
	
	/**
	 * Gets the pad url.
	 *
	 * @return the pad url
	 */
	public String getPadUrl() {
		return padUrl;
	}

	/**
	 * The Class Tokenizer.
	 */
	public static class Tokenizer implements PlaceTokenizer<Workplace> {

		/* (non-Javadoc)
		 * @see com.google.gwt.place.shared.PlaceTokenizer#getToken(com.google.gwt.place.shared.Place)
		 */
		public String getToken(Workplace place) {
			return "";
		}

		/* (non-Javadoc)
		 * @see com.google.gwt.place.shared.PlaceTokenizer#getPlace(java.lang.String)
		 */
		public Workplace getPlace(String token) {
			return new Workplace("nopad","nopad");
		}

	}
}
